package com.j2110.utils;

public class Result {
    private boolean success;
    private String msg;
    private Object data;

    private Result(Object data){
        this.success = true;
        this.data = data;
    }

    private Result(){
        this.success = true;
    }

    private Result(Boolean success){
        this.success = success;
    }

    public static Result me(Object data){
        return new Result(data);
    }


    public static Result me(){
        return new Result();
    }

    public static Result me(Boolean success){
        return new Result(success);
    }

    public Result setMsg(String msg){
        this.msg = msg;
        return this;
    }

    public boolean isSuccess() {
        return success;
    }

    public String getMsg() {
        return msg;
    }

    public Object getData() {
        return data;
    }
}
